<?php
    $dir="D:\\php\\php1.php";
    if(is_dir($dir)){
        if($dh=openddir($dir)){
            while(($file=readdir($dh)) !==false){
                echo "\n 文件名为：" . $file;
            }
        }
        else{
            echo "路径错误";
            exit();
        }
        closedir($dh);
    }
    echo "\n 执行结束";

?>